﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Sudum
{
    class GameState_Play : IGameState
    {
        private GameLevel level;

        public GameState_Play()
        {
            // create empty level here
            level = new GameLevel();
        }

        public bool SetLevel()
        {
            bool bSuccess = GameLevel.Current().Load();
            return bSuccess;
        }

        public FlowAction Update()
        {
			if (InputManager.Me.Pressed(Action.Exit))
                return FlowAction.FlowTo_PrincipalMenu;

            level.Update();
            return FlowAction.FlowTo_Continue;
        }

        public void Render()
        {
            Sudum.Me.GraphicsDevice.Clear(Color.Black);
            level.Draw();
        }
    }
}
